<!DOCTYPE html>
<html lang="en">
<head>
<title>WebView4Delphi: uWVTypeLibrary: Interface ICoreWebView2PrintSettings2</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0-snapshot">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<span id="ICoreWebView2PrintSettings2"></span><h1 class="cio">Interface ICoreWebView2PrintSettings2</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></div><div class="one_section">Fields</div><div class="one_section"><a class="section" href="#PasDoc-Methods">Methods</a></div><div class="one_section">Properties</div></div>
<span id="PasDoc-Description"></span><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="uWVTypeLibrary.html">uWVTypeLibrary</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type ICoreWebView2PrintSettings2 = interface(<a class="normal" href="uWVTypeLibrary.ICoreWebView2PrintSettings.html">ICoreWebView2PrintSettings</a>)</code></p>
<h2 class="description">Description</h2>
<p>
 Settings used by the Print method. </p>
<p>


<p>&lt;see href=&quot;<a href="https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2printsettings2">https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2printsettings2</a>&quot;&gt;See the ICoreWebView2PrintSettings2 article.)</p>
<span id="PasDoc-Hierarchy"></span><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">IUnknown</li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2PrintSettings.html">ICoreWebView2PrintSettings</a></li>
<li class="thisitem">ICoreWebView2PrintSettings2</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Methods"></span><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Get_PageRanges-PWideChar-">Get_PageRanges</a></strong>(out value: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Set_PageRanges-PWideChar-">Set_PageRanges</a></strong>(value: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Get_PagesPerSide-SYSINT-">Get_PagesPerSide</a></strong>(out value: SYSINT): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Set_PagesPerSide-SYSINT-">Set_PagesPerSide</a></strong>(value: SYSINT): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Get_Copies-SYSINT-">Get_Copies</a></strong>(out value: SYSINT): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Set_Copies-SYSINT-">Set_Copies</a></strong>(value: SYSINT): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Get_Collation-COREWEBVIEW2_PRINT_COLLATION-">Get_Collation</a></strong>(out value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_COLLATION">COREWEBVIEW2_PRINT_COLLATION</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Set_Collation-COREWEBVIEW2_PRINT_COLLATION-">Set_Collation</a></strong>(value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_COLLATION">COREWEBVIEW2_PRINT_COLLATION</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Get_ColorMode-COREWEBVIEW2_PRINT_COLOR_MODE-">Get_ColorMode</a></strong>(out value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_COLOR_MODE">COREWEBVIEW2_PRINT_COLOR_MODE</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Set_ColorMode-COREWEBVIEW2_PRINT_COLOR_MODE-">Set_ColorMode</a></strong>(value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_COLOR_MODE">COREWEBVIEW2_PRINT_COLOR_MODE</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Get_Duplex-COREWEBVIEW2_PRINT_DUPLEX-">Get_Duplex</a></strong>(out value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_DUPLEX">COREWEBVIEW2_PRINT_DUPLEX</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Set_Duplex-COREWEBVIEW2_PRINT_DUPLEX-">Set_Duplex</a></strong>(value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_DUPLEX">COREWEBVIEW2_PRINT_DUPLEX</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Get_MediaSize-COREWEBVIEW2_PRINT_MEDIA_SIZE-">Get_MediaSize</a></strong>(out value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_MEDIA_SIZE">COREWEBVIEW2_PRINT_MEDIA_SIZE</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Set_MediaSize-COREWEBVIEW2_PRINT_MEDIA_SIZE-">Set_MediaSize</a></strong>(value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_MEDIA_SIZE">COREWEBVIEW2_PRINT_MEDIA_SIZE</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Get_PrinterName-PWideChar-">Get_PrinterName</a></strong>(out value: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2PrintSettings2.html#Set_PrinterName-PWideChar-">Set_PrinterName</a></strong>(value: PWideChar): HResult; stdcall;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_PageRanges-PWideChar-"></span><code>function <strong>Get_PageRanges</strong>(out value: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Page range to print. Defaults to empty string, which means print all pages. If the Page range is empty string or null, then it applies the default.

<p>The PageRanges property is a list of page ranges specifying one or more pages that should be printed separated by commas. Any whitespace between page ranges is ignored. A valid page range is either a single integer identifying the page to print, or a range in the form `[start page]-[last page]` where `start page` and `last page` are integers identifying the first and last inclusive pages respectively to print. Every page identifier is an integer greater than 0 unless wildcards are used (see below examples). The first page is 1.

<p>In a page range of the form `[start page]-[last page]` the start page number must be larger than 0 and less than or equal to the document's total page count. If the `start page` is not present, then 1 is used as the `start page`. The `last page` must be larger than the `start page`. If the `last page` is not present, then the document total page count is used as the `last page`.

<p>Repeating a page does not print it multiple times. To print multiple times, use the `Copies` property.

<p>The pages are always printed in ascending order, even if specified in non-ascending order.

<p>If page range is not valid or if a page is greater than document total page count, `ICoreWebView2PrintCompletedHandler` or `ICoreWebView2PrintToPdfStreamCompletedHandler` handler will return `E_INVALIDARG`.

<p>The following examples assume a document with 20 total pages.

<p>| Example | Result | Notes | | &mdash; | &mdash; | &mdash; | | &quot;2&quot; | Page 2 | | | &quot;1-4, 9, 3-6, 10, 11&quot; | Pages 1-6, 9-11 | | | &quot;1-4, -6&quot; | Pages 1-6 | The &quot;-6&quot; is interpreted as &quot;1-6&quot;. | | &quot;2-&quot; | Pages 2-20 | The &quot;2-&quot; is interpreted as &quot;pages 2 to the end of the document&quot;. | | &quot;4-2, 11, -6&quot; | Invalid | &quot;4-2&quot; is an invalid range. | | &quot;-&quot; | Pages 1-20 | The &quot;-&quot; is interpreted as &quot;page 1 to the end of the document&quot;. | | &quot;1-4dsf, 11&quot; | Invalid | | | &quot;2-2&quot; | Page 2 | |

<p>The caller must free the returned string with `CoTaskMemFree`. See [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings) </p>
<h6 class="description_section">Attributes</h6>
<dl class="attributes">
  <dt>GUID['{CA7F0E1F-3484-41D1-8C1A-65CD44A63F8D}']</dt>
  <dd></dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_PageRanges-PWideChar-"></span><code>function <strong>Set_PageRanges</strong>(value: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Set the `PageRanges` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_PagesPerSide-SYSINT-"></span><code>function <strong>Get_PagesPerSide</strong>(out value: SYSINT): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Prints multiple pages of a document on a single piece of paper. Choose from 1, 2, 4, 6, 9 or 16. The default value is 1. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_PagesPerSide-SYSINT-"></span><code>function <strong>Set_PagesPerSide</strong>(value: SYSINT): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Set the `PagesPerSide` property. Returns `E_INVALIDARG` if an invalid value is provided, and the current value is not changed.

<p>Below examples shows print output for PagesPerSide and Duplex.

<p>| PagesPerSide | Total pages | Two-sided printing | Result | | &mdash; | &mdash; | &mdash; | &mdash; | | 1 | 1 | - | 1 page on the front side. | | 2 | 1 | Yes | 1 page on the front side. | | 2 | 4 | - | 2 pages on the first paper and 2 pages on the next paper. | | 2 | 4 | Yes | 2 pages on the front side and 2 pages on back side. | | 4 | 4 | Yes | 4 pages on the front side. | | 4 | 8 | Yes | 4 pages on the front side and 4 pages on the back side. | </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_Copies-SYSINT-"></span><code>function <strong>Get_Copies</strong>(out value: SYSINT): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Number of copies to print. Minimum value is `1` and the maximum copies count is `999`. The default value is 1.

<p>This value is ignored in PrintToPdfStream method. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_Copies-SYSINT-"></span><code>function <strong>Set_Copies</strong>(value: SYSINT): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Set the `Copies` property. Returns `E_INVALIDARG` if an invalid value is provided and the current value is not changed. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_Collation-COREWEBVIEW2_PRINT_COLLATION-"></span><code>function <strong>Get_Collation</strong>(out value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_COLLATION">COREWEBVIEW2_PRINT_COLLATION</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Printer collation. See `COREWEBVIEW2_PRINT_COLLATION` for descriptions of collation. The default value is `COREWEBVIEW2_PRINT_COLLATION_DEFAULT`.

<p>Printing uses default value of printer's collation if an invalid value is provided for the specific printer.

<p>This value is ignored in PrintToPdfStream method. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_Collation-COREWEBVIEW2_PRINT_COLLATION-"></span><code>function <strong>Set_Collation</strong>(value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_COLLATION">COREWEBVIEW2_PRINT_COLLATION</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Set the `Collation` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_ColorMode-COREWEBVIEW2_PRINT_COLOR_MODE-"></span><code>function <strong>Get_ColorMode</strong>(out value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_COLOR_MODE">COREWEBVIEW2_PRINT_COLOR_MODE</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Printer color mode. See `COREWEBVIEW2_PRINT_COLOR_MODE` for descriptions of color modes. The default value is `COREWEBVIEW2_PRINT_COLOR_MODE_DEFAULT`.

<p>Printing uses default value of printer supported color if an invalid value is provided for the specific printer. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_ColorMode-COREWEBVIEW2_PRINT_COLOR_MODE-"></span><code>function <strong>Set_ColorMode</strong>(value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_COLOR_MODE">COREWEBVIEW2_PRINT_COLOR_MODE</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Set the `ColorMode` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_Duplex-COREWEBVIEW2_PRINT_DUPLEX-"></span><code>function <strong>Get_Duplex</strong>(out value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_DUPLEX">COREWEBVIEW2_PRINT_DUPLEX</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Printer duplex settings. See `COREWEBVIEW2_PRINT_DUPLEX` for descriptions of duplex. The default value is `COREWEBVIEW2_PRINT_DUPLEX_DEFAULT`.

<p>Printing uses default value of printer's duplex if an invalid value is provided for the specific printer.

<p>This value is ignored in PrintToPdfStream method. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_Duplex-COREWEBVIEW2_PRINT_DUPLEX-"></span><code>function <strong>Set_Duplex</strong>(value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_DUPLEX">COREWEBVIEW2_PRINT_DUPLEX</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Set the `Duplex` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_MediaSize-COREWEBVIEW2_PRINT_MEDIA_SIZE-"></span><code>function <strong>Get_MediaSize</strong>(out value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_MEDIA_SIZE">COREWEBVIEW2_PRINT_MEDIA_SIZE</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Printer media size. See `COREWEBVIEW2_PRINT_MEDIA_SIZE` for descriptions of media size. The default value is `COREWEBVIEW2_PRINT_MEDIA_SIZE_DEFAULT`.

<p>If media size is `COREWEBVIEW2_PRINT_MEDIA_SIZE_CUSTOM`, you should set the `PageWidth` and `PageHeight`.

<p>Printing uses default value of printer supported media size if an invalid value is provided for the specific printer.

<p>This value is ignored in PrintToPdfStream method. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_MediaSize-COREWEBVIEW2_PRINT_MEDIA_SIZE-"></span><code>function <strong>Set_MediaSize</strong>(value: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_MEDIA_SIZE">COREWEBVIEW2_PRINT_MEDIA_SIZE</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Set the `MediaSize` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_PrinterName-PWideChar-"></span><code>function <strong>Get_PrinterName</strong>(out value: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 The name of the printer to use. Defaults to empty string. If the printer name is empty string or null, then it prints to the default printer on the user OS.

<p>This value is ignored in PrintToPdfStream method.

<p>The caller must free the returned string with `CoTaskMemFree`. See [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings) </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_PrinterName-PWideChar-"></span><code>function <strong>Set_PrinterName</strong>(value: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Set the `PrinterName` property. If provided printer name doesn't match with the name of any installed printers on the user OS, `ICoreWebView2PrintCompletedHandler` handler will return `errorCode` as `S_OK` and `printStatus` as COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE.

<p>Use [Enum Printers](/windows/win32/printdocs/enumprinters) to enumerate available printers. </p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0-snapshot</a>. </em>
</span>
</body></html>
